﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.DialogUI {
    import flash.display.*;
    import Events.*;
    import flash.utils.*;
    import org.aswing.*;
    import Classes.util.*;
    import Display.aswingui.*;

    public class DailyBonusDialog extends GenericDialog {

        private var m_arrow:DisplayObject;
        protected var m_arrowSprite:Sprite;
        protected var m_isBonusAvailable:Boolean;
        protected var m_isRecoveryNeeded:Boolean;

        public function DailyBonusDialog(_arg1:String, _arg2:String="", _arg3:int=0, _arg4:Function=null, _arg5:String="", _arg6:String="", _arg7:Boolean=true){
            this.m_isBonusAvailable = Global.player.dailyBonusManager.isBonusAvailable;
            this.m_isRecoveryNeeded = Global.player.dailyBonusManager.isRecoveryNeeded;
            super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7);
        }
        override protected function loadAssets():void{
            Global.delayedAssets.get(DelayedAssetLoader.DAILY_BONUS_ASSETS, makeAssets);
        }
        override protected function createAssetDict():Dictionary{
            var _local1:Dictionary = new Dictionary();
            _local1["dailyBonus_bg"] = m_comObject.dailyBonus_bg;
            _local1["dailyBonus_check"] = m_comObject.dailyBonus_check;
            _local1["doober_coin"] = m_comObject.doober_coin;
            _local1["doober_xp"] = m_comObject.doober_star;
            _local1["doober_energy"] = m_comObject.doober_bolt;
            _local1["doober_goods"] = m_comObject.doober_goods;
            _local1["dailyBonus_present_big"] = m_comObject.dailyBonus_present_big;
            _local1["dailyBonus_hr"] = m_comObject.dailyBonus_hr;
            _local1["dailyBonus_tab"] = m_comObject.dailyBonus_tab;
            _local1["dailyBonus_tab_left_regular"] = m_comObject.dailyBonus_tab_left_regular;
            _local1["dailyBonus_tab_left_green"] = m_comObject.dailyBonus_tab_left_green;
            _local1["dailyBonus_tab_left_green_selected"] = m_comObject.dailyBonus_tab_left_green_selected;
            _local1["dailyBonus_tab_left_red"] = m_comObject.dailyBonus_tab_left_red;
            _local1["dailyBonus_tab_left_red_selected"] = m_comObject.dailyBonus_tab_left_red_selected;
            _local1["dailyBonus_tab_mid_regular"] = m_comObject.dailyBonus_tab_mid_regular;
            _local1["dailyBonus_tab_mid_green"] = m_comObject.dailyBonus_tab_mid_green;
            _local1["dailyBonus_tab_mid_green_selected"] = m_comObject.dailyBonus_tab_mid_green_selected;
            _local1["dailyBonus_tab_mid_red"] = m_comObject.dailyBonus_tab_mid_red;
            _local1["dailyBonus_tab_mid_red_selected"] = m_comObject.dailyBonus_tab_mid_red_selected;
            _local1["dailyBonus_tab_right_regular"] = m_comObject.dailyBonus_tab_right_regular;
            _local1["dailyBonus_tab_right_green"] = m_comObject.dailyBonus_tab_right_green;
            _local1["dailyBonus_tab_right_green_selected"] = m_comObject.dailyBonus_tab_right_green_selected;
            _local1["dailyBonus_tab_right_red"] = m_comObject.dailyBonus_tab_right_red;
            _local1["dailyBonus_tab_right_red_selected"] = m_comObject.dailyBonus_tab_right_red_selected;
            _local1["dailyBonus_x"] = m_comObject.dailyBonus_x;
            this.m_arrow = (new m_comObject.dailyBonus_nextDayArrow() as DisplayObject);
            return (_local1);
        }
        override protected function createDialogView(_arg1:Dictionary):GenericDialogView{
            var _local2:GenericDialogView = new DailyBonusDialogView(_arg1, this.m_isBonusAvailable, this.m_isRecoveryNeeded, m_message, m_dialogTitle, m_type, m_callback, m_icon);
            return (_local2);
        }
        override protected function init():void{
            m_holder = new Sprite();
            this.addChild(m_holder);
            m_jwindow = new JWindow(m_holder);
            this.m_arrowSprite = new Sprite();
            m_holder.addChild(this.m_arrowSprite);
            m_content = m_holder;
            m_content.addEventListener(GenericPopupEvent.SELECTED, processSelection, false, 0, true);
            m_content.addEventListener(UIEvent.REFRESH_DIALOG, onRefreshDialog, false, 0, true);
            m_content.addEventListener("close", closeMe, false, 0, true);
        }
        override protected function finalizeAndShow():void{
            ASwingHelper.prepare(m_jpanel);
            m_jwindow.setContentPane(m_jpanel);
            ASwingHelper.prepare(m_jwindow);
            var _local1:int = m_jwindow.getWidth();
            var _local2:int = m_jwindow.getHeight();
            m_jwindow.show();
            m_holder.width = _local1;
            m_holder.height = _local2;
            setupDialogStatsTracking();
            onDialogInitialized();
        }

    }
}//package Display.DialogUI 
